class Calculator {
  // add 方法，计算两个整数的和并记录日志
  def calculate(x: Int, y: Int, operate: Char): Any = operate match {
    case '+' => x + y;
    case '-' => x - y;
    case '*' => x * y;
    case '/' => x / y;
    case _   => "Invalid operator"
  }
}

// 测试代码
object Main extends App {
  // 创建 Calculator 实例
  val calculator = new Calculator()
  print(calculator.calculate(10, 5, '*'))
}
